package com.usf.jprovider.schema.type;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;

import com.usf.jprovider.object.env.Environment;
import com.usf.jprovider.object.type.JType;
import com.usf.jprovider.schema.AbstractObject;

@XmlSeeAlso({
	DBInteger.class,
	DBDouble.class,
	DBString.class,
	DBDate.class})

public abstract class AbstractDBType extends AbstractObject{

	@XmlAttribute protected String format;
	
	protected AbstractDBType(){
		super();
		format = "";
	}

	public String getFormat() {
		return format;
	}
	
	@Override
	public final String toString() {
		return "AbstractDBType [format=" + format + "]";
	}
	
	public abstract String formatSQL(Environment env, String value) throws Exception;
	public abstract JType<?> toJType(String value) throws Exception;
}
